//
//  MCLoginPageViewController.swift
//  StoreManage
//
//  Created by MC on 2018/8/29.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCLoginPageViewController: MCPageViewController {

    
    var navBarHairLineImageView : UIImageView?
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navBarHairLineImageView?.isHidden = true
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        navBarHairLineImageView?.isHidden = false
    }
    

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        baseSetting()
        
        initUI()
        
        managerClosure()
        
        sendNetworking()
    }
    
    // MARK: - System Delegate
    
    // MARK: - Custom Delegate
    
    // MARK: - Closure
    func managerClosure() { }
    
    // MARK: - Action
    @objc func leftItemEvent() {
        // 空方法。 隐藏左侧返回按钮。 
    }
    
    // MARK: - Network
    func sendNetworking() {
        
    }
    
    // MARK: - Method
    func baseSetting() {
        title = "登录"
        navBarHairLineImageView = MCFindNavigationBarLine(view: (navigationController?.navigationBar)!)
        
        navigationItem.leftBarButtonItem = MCSetBarButtonItem_text("", target: self, selector: #selector(leftItemEvent))
    }
        
    func initUI() {

        let vc1 = MCLoginPasswordViewController()
        let vc2 = MCLoginDynamicViewController()
        
        vc1.fatherVC = self
        vc2.fatherVC = self;

        vc1.closure = { vc in
            MCPushToViewController(current: self, target: vc, isHiddenBottomBarWhenBack: true)
        }
        
        
        let titleArray = ["账号密码登录","动态密码登录"]
        let vcArray  = [vc1,vc2]
        
        self.initWithTitleArray(titleArray, vcArray: vcArray, blockNormalColor: UIColor.MCGray_middle, blockSelectedColor: UIColor.MCMain, currentPage: 0)
        
    }
    
    // MARK: - Setter & Getter
}
